/*
 * @Descripttion:
 * @version: 1.0
 * @Author: Teemor
 * @Date: 2024-04-10 14:27:07
 */
import { defineStore } from 'pinia'
import { ref } from 'vue'

const initState = { themeColor: '#226CFF' }

export const useThemeStore = defineStore(
  'theme',
  () => {
    const themeConfig = ref({ ...initState })

    const setThemeConfig = (val) => {
      themeConfig.value = val
    }
    const clearThemeConfig = () => {
      themeConfig.value = { ...initState }
    }
    const reset = () => {
      themeConfig.value = { ...initState }
    }

    return {
      themeConfig,
      setThemeConfig,
      clearThemeConfig,
      reset,
    }
  },
  {
    persist: true,
  },
)
